package com.vue.vuedemo.map;

import com.vue.vuedemo.pojo.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import javax.xml.ws.WebServiceClient;
import java.util.List;

@Mapper
public interface CommentMapper {
	
	
	@Select("select * from comment where id=#{id}")
	public List<Comment> getCommentByid(int id);
	
    @Select("select * from comment where nid=#{nid}")
    public List<Comment> getCommentByNid(int nid);

    @Select("select * from comment where pid=#{pid}")
    public List<Comment> getCommentByPid(int pid);

    @Select("select * from comment where gid=#{gid}")
    public List<Comment> getCommentByGid(int gid);


    @Insert("insert into comment values(#{id},#{add_time},#{content},#{gid},#{nid},#{pid},#{user_name})")
    public void postcomment(Comment comment);
}
